package com.zhanghu.backendZray.controller.oilPrice;

import com.zhanghu.backendZray.pojo.dto.ApiResponse;
import com.zhanghu.backendZray.pojo.vo.oilPrice.OilPriceVo;
import com.zhanghu.backendZray.service.OilPriceService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 油价 前端控制器
 * </p>
 *
 * @author zhangdong
 * @since 2025-01-19
 */
@RestController
@RequestMapping("oilPrice")
@RequiredArgsConstructor
public class OilPriceController {
    private final OilPriceService oilPriceService;

    /**
     * 查询今日油价
     */
    @GetMapping("today")
    public ApiResponse<List<OilPriceVo>> today() {
        List<OilPriceVo> list = oilPriceService.today();
        return ApiResponse.ok(list);
    }

}
